home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 5⁄25⁄90 / 1331-MacApp Final Bugs⁄Co-May90 < prev    next >
Encoding:
Text File  |  1990-05-25  |  3.3 KB  |  109 lines  |  [TEXT/GEOL]

  1. Item    8555043                         24-May-90        02:36PDT
  2.  
  3. From:   MADA2                           MacApp Dev Assoc, Curtis Faith,IVC
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.         MACAPP.TEST                     MacApp SQA Team
  7.         MACDTS                          Macintosh Developer Tech Supt
  8.  
  9. Sub:    MacApp Final Bugs/Comments
  10.  
  11. I just received MacApp final from APDA and thought I would mention the
  12. following:
  13.  
  14. 1) Modeless TDialogViews don't Dismiss when a TControl that fDismisses is
  15. pressed.  What happens is that TDialogView properly calls DismissDialog, but
  16. all that DismissDialog does is set fDismissed to TRUE and set the fDismisser
  17. field to the view that was passed in.
  18.  
  19. Pressing a "dismisses" button, for example, does not dismiss when a Window is
  20. opened with a call to TWindow.Open instead of TDialogView.PoseModally.  Only
  21. PoseModally uses the fDismissed field.
  22.  
  23. This really limits the usefulness of modeless dialogs.
  24.  
  25. One workaround is to OVERRIDE TDialogView:
  26.  
  27. a) Add a field fDismissClosesWindow: Boolean;
  28.  
  29. b) OVERRIDE PoseModally to set fDismissClosesWindow to FALSE before its repeat
  30. loop and set it to TRUE after.
  31.  
  32. c) OVERRIDE Close with:
  33.     fDismissClosesWindow := FALSE;
  34.     INHERITED Close;
  35.  
  36.     This is to avoid recursive calls to close, because close calls
  37. DismissDialog which would otherwise call GetWindow.Close resulting in a further
  38. call to SELF.Close etc., etc., etc.
  39.  
  40. d) OVERRIDE DismissDialog adding this line after "fDismisser := dismisser":
  41.     IF fDismissClosesWindow THEN
  42.         GetWindow.Close;
  43.  
  44. e) OVERRIDE IRes and IDialogView to set fDismissClosesWindow to TRUE.
  45.  
  46. That should do it.
  47.  
  48. I personally consider this to be a bug!
  49.  
  50. 2) TDialogView will call DoChoice on a button that is disabled as the result of
  51. a key press.  If one disables the default button and presses return for
  52. example, the button's DoChoice method still gets called!
  53.  
  54. IF defaultView.IsViewEnabled THEN
  55.   TControl(defaultView).Flash;
  56. TControl(defaultView).DoChoice(defaultView,TControl(defaultView).fDefChoice);
  57.  
  58. Should be replaced by:
  59.  
  60. IF defaultView.IsViewEnabled THEN
  61.   BEGIN
  62.   TControl(defaultView).Flash;
  63.   TControl(defaultView).DoChoice(defaultView,TControl(defaultView).fDefChoice);
  64.   END;
  65.  
  66. You can do this in the same TDialogView OVERRIDE as above if you hesitate to
  67. change MacApp.
  68.  
  69. I definately would call this one a bug!
  70.  
  71. 3) This is not really a bug but, if you used to call FreeAll on the fSubviews
  72. field of a View this will no longer work.  What happens is this:
  73.  
  74. FreeAll calls:
  75.  
  76.    Each(FreeIfObject);
  77.    DeleteAll;
  78.  
  79. in the process of freeing each subview TView.RemoveSubview checks to see if the
  80. fSubViews list is empty if it is then it FreeIfObject's it and sets the
  81. fSubViews field to NIL.  This has the nasty effect of confusing fSubViews which
  82. is in the middle of executing its method when it is freed, it Bombs wonderfully
  83. at DeleteAll.
  84.  
  85. To Remove all subviews you now need to do this:
  86.  
  87. Declare a local procedure:
  88.  
  89. PROCEDURE RemoveAndFree (aSubView: TView);
  90.     BEGIN
  91.     RemoveSubView(aSubView);
  92.     FreeIfObject(aSubView);
  93.     END;
  94.  
  95. Then call:
  96.  
  97. IF fSubViews <> NIL THEN
  98.     fSubViews.Each(RemoveAndFree);
  99.  
  100. On the whole the new functionality is probably better anyway, but I thought I
  101. would warn anyone who might run into this problem.
  102.  
  103. I remain as always,
  104.  
  105. Befuddled but Merry,
  106.  
  107. Curtis
  108.  
  109.